import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '订单号',
    align:"center",
    dataIndex: 'orderNum'
   },
   {
    title: '物料编码',
    align:"center",
    dataIndex: 'goodsCode'
   },
   {
    title: '物料名称',
    align:"center",
    dataIndex: 'goodsName'
   },
   {
    title: '订单数量',
    align:"center",
    dataIndex: 'goodsCount'
   },
   {
    title: '未验收数量',
    align:"center",
    dataIndex: 'goodsSyCount'
   },
   {
    title: '已验收数量',
    align:"center",
    dataIndex: 'goodsDjCount'
   },
   {
    title: '生产日期',
    align:"center",
    dataIndex: 'goodsProDate'
   },
   {
    title: '批次',
    align:"center",
    dataIndex: 'goodsBatch'
   },
   {
    title: '规格',
    align:"center",
    dataIndex: 'goodsSpec'
   },
   {
    title: '单位名称',
    align:"center",
    dataIndex: 'goodsUnitName'
   },
   
   {
    title: '明细状态',
    align:"center",
    dataIndex: 'lineStatus'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remark'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "订单号",
      field: 'orderNum',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "物料编码",
      field: 'goodsCode',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "批次",
      field: 'goodsBatch',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "物料名称",
      field: 'goodsName',
      component: 'Input',
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '订单号',
    field: 'orderNum',
    component: 'Input',
    componentProps: {
      disabled: true,
    },
  },
  {
    label: '物料编码',
    field: 'goodsCode',
    component: 'Input',
    componentProps: {
      disabled: true,
    },
  },
  {
    label: '物料名称',
    field: 'goodsName',
    component: 'Input',
    componentProps: {
      disabled: true,
    },
  },
  {
    label: '单据数量',
    field: 'goodsCount',
    component: 'Input',
    componentProps: {
      disabled: true,
    },
  },
  {
    label: '未验收数量',
    field: 'goodsSyCount',
    component: 'Input',
    componentProps: {
      disabled: true,
    },
  },
  {
    label: '已验收数量',
    field: 'goodsDjCount',
    component: 'Input',
    componentProps: {
      disabled: true,
    },
  },
  {
    label: '验收数量',
    field: 'goodsYsCount',
    component: 'Input',
    //自动触发检验，布尔类型
    required: true,
  },
  {
    label: '合格标识',
    field: 'qcMark',
    component: 'RadioGroup',
    required:true,
    defaultValue: 'Y',
    componentProps: {
      options: [
        {
          label: '合格',
          value: '合格',
        },
        {
          label: '不合格',
          value: '不合格',
        },
      ],
    },
  },
  {
    label: '生产日期',
    field: 'goodsProDate',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       disabled: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '标签号',
    field: 'binCode',
    component: 'Input',
    required: true,
  },
  {
    label: '托盘编码',
    field: 'trayCode',
    component: 'Input',
    required: true,
  },
  {
    label: '批次',
    field: 'goodsBatch',
    component: 'Input',
    componentProps: {
      disabled: true,
    },
  },
  {
    label: '单位名称',
    field: 'goodsUnitName',
    component: 'Input',
    componentProps: {
      disabled: true,
    },
  },
  
  {
    label: '状态',
    field: 'lineStatus',
    component: 'Input',
    componentProps: {
      disabled: true,
    },
  },
  
  {
    label: '规格',
    field: 'goodsSpec',
    component: 'InputTextArea',
    componentProps: {
      disabled: true,
    },
  },
 
  {
    label: '备注',
    field: 'remark',
    component: 'InputTextArea',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}